1965f042310eae543126a79dbea347208a60eb49,FredBoat/src/main/java/fredboat/command/music/seeking/ForwardCommand.java,ForwardCommand,onInvoke,#Guild#TextChannel#Member#Message#String[]#,43
Before Change
GuildPlayer player = PlayerRegistry.getExisting(guild);
if(player == null || player.isQueueEmpty()) {
TextUtils.replyWithName(channel, invoker, "The queue is empty.");
return;
}
if(args.length == 1) {
TextUtils.replyWithName(channel, invoker, "Proper usage:\n`;;forward [[hh:]mm:]ss`");
return;
}
long t;
try {
t = TextUtils.parseTimeString(args[1]);
} catch (IllegalStateException e){
TextUtils.replyWithName(channel, invoker, "Proper usage:\n`;;forward [[hh:]mm:]ss`");
return;
}
AudioTrackContext atc = player.getPlayingTrack();
AudioTrack at = atc.getTrack();
//Ensure bounds
t = Math.max(0, t);
t = Math.min(atc.getEffectiveDuration(), t);
at.setPosition(at.getPosition() + t);
channel.sendMessage("Forwarding **" + atc.getEffectiveTitle() + "** by " + TextUtils.formatTime(t) + ".").queue();
}
}
After Change
GuildPlayer player = PlayerRegistry.getExisting(guild);
if(player == null || player.isQueueEmpty()) {
TextUtils.replyWithName(channel, invoker, I13n.get(guild).getString("unpauseQueueEmpty"));
return;
}
if(args.length == 1) {
TextUtils.replyWithName(channel, invoker, I13n.get(guild).getString("fwdUsage"));
return;
}
long t;
try {
t = TextUtils.parseTimeString(args[1]);
} catch (IllegalStateException e){
TextUtils.replyWithName(channel, invoker, I13n.get(guild).getString("fwdUsage"));
return;
}
AudioTrackContext atc = player.getPlayingTrack();
AudioTrack at = atc.getTrack();
//Ensure bounds
t = Math.max(0, t);
t = Math.min(atc.getEffectiveDuration(), t);
at.setPosition(at.getPosition() + t);
channel.sendMessage(MessageFormat.format(I13n.get(guild).getString("fwdSuccess"), atc.getEffectiveTitle(), TextUtils.formatTime(t))).queue();
}
}